<!-- Generated automatically from an XML file of the same name.
     Copyright: Stephen J. Sangwine and Nicolas Le Bihan, 2008-2011.
--><html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <title>cumprod :: Functions (Quaternion Toolbox Function Reference)
</title><link rel="stylesheet" href="qtfmstyle.css" type="text/css"></head><body><h1>Quaternion Function Reference</h1><h2>cumprod</h2>
<p>Cumulative product<br>(Quaternion overloading of standard MATLAB&reg; function)
</p>
<h2>Syntax</h2><p><tt>Y = cumprod(X, dim)</tt></p>
<h2>Description</h2>
<p>
<tt>cumprod(X)</tt> computes the cumulative product of the quaternion
argument. If the argument is a vector, the result is a vector. If the argument
is a matrix, the cumulative product is computed along the columns by default.
As with the equivalent MATLAB&reg; function, the <tt>dim</tt> parameter
permits the product to be computed along a specified dimension.
</p>
<p>
The ordering within the product is important, because of the non-commutative
quaternion product: the product is computed with the lowest index on the
left and the highest index on the right
(that is, left to right for a row vector, or downwards for a column vector).
</p>

<h2>Examples</h2>
The cumulative product of a vector containing the three quaternion operators
gives a vector with the three values <tt>qi</tt>, <tt>qk</tt> and
<tt>-1</tt>:
<pre>
&gt;&gt; cumprod([qi, qj, qk])
 
ans = 1x3 quaternion array
 
&gt;&gt; show(ans)
 
ans.S =
 
     0     0    -1

ans.X =
 
     1     0     0

ans.Y =
 
     0     0     0

ans.Z =
 
     0     1     0
</pre>

<h2>See Also</h2>MATLAB&reg; function: <a href="matlab:doc cumprod">cumprod</a><br>QTFM functions: <a href="cumsum.html">cumsum</a>, <a href="prod.html">prod</a>, <a href="sum.html">sum</a><br>
<h4>&copy; 2008-2011 Stephen J. Sangwine and Nicolas Le Bihan</h4><p><a href="license.html">License terms.</a></p></body></html>